using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using PCSComUtils.Admin.DS;
using PCSComUtils.Common;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;
using PCSUtils.Admin;
using PCSComUtils.DataContext;

namespace PCSUtils.Admin
{
	/// <summary>
	/// This form will display list of icons for selecting
	/// Designed by: Hung LA.
	/// Implemented by: Duong NA.	
	/// </summary>	
	public class SelectIcon : System.Windows.Forms.Form
	{
		#region Declaration
		
		#region System Generated

		private System.Windows.Forms.ImageList imglTreeNode;
		private System.Windows.Forms.ListView lvwIcons;
		private System.Windows.Forms.RadioButton radCollapsed;
		private System.Windows.Forms.RadioButton radExpanded;
		private System.Windows.Forms.PictureBox picCollapsed;
		private System.Windows.Forms.PictureBox picExpanded;
		private System.Windows.Forms.Label lblLabelMenuEntry;
		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Button btnOk;
		private System.Windows.Forms.TextBox txtMenuName;
		
		#endregion System Generated

		private const string THIS = "PCSUtils.Admin.SelectIcon";		
		//added by duongna (18-Sep-2005) to present image index for menu tree nodes
		private const int IDX_IMAGE_EXPANDED_FOLDER = 0;
		private const int IDX_IMAGE_FOLDER = 1;
		private const int IDX_IMAGE_FORM = 2;
		
		private Sys_Menu_EntryVO mMenuEntry;
		private bool mIsGroup;

		#endregion Declaration

		#region Constructor, Destructor
		
		public SelectIcon()
		{		
			InitializeComponent();
		}

		
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		
		
		#endregion Constructor, Destructor

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SelectIcon));
			this.lvwIcons = new System.Windows.Forms.ListView();
			this.imglTreeNode = new System.Windows.Forms.ImageList(this.components);
			this.lblLabelMenuEntry = new System.Windows.Forms.Label();
			this.radCollapsed = new System.Windows.Forms.RadioButton();
			this.radExpanded = new System.Windows.Forms.RadioButton();
			this.picCollapsed = new System.Windows.Forms.PictureBox();
			this.picExpanded = new System.Windows.Forms.PictureBox();
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnOk = new System.Windows.Forms.Button();
			this.txtMenuName = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// lvwIcons
			// 
			this.lvwIcons.AccessibleDescription = resources.GetString("lvwIcons.AccessibleDescription");
			this.lvwIcons.AccessibleName = resources.GetString("lvwIcons.AccessibleName");
			this.lvwIcons.Alignment = ((System.Windows.Forms.ListViewAlignment)(resources.GetObject("lvwIcons.Alignment")));
			this.lvwIcons.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lvwIcons.Anchor")));
			this.lvwIcons.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("lvwIcons.BackgroundImage")));
			this.lvwIcons.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lvwIcons.Dock")));
			this.lvwIcons.Enabled = ((bool)(resources.GetObject("lvwIcons.Enabled")));
			this.lvwIcons.Font = ((System.Drawing.Font)(resources.GetObject("lvwIcons.Font")));
			this.lvwIcons.FullRowSelect = true;
			this.lvwIcons.HideSelection = false;
			this.lvwIcons.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lvwIcons.ImeMode")));
			this.lvwIcons.LabelWrap = ((bool)(resources.GetObject("lvwIcons.LabelWrap")));
			this.lvwIcons.LargeImageList = this.imglTreeNode;
			this.lvwIcons.Location = ((System.Drawing.Point)(resources.GetObject("lvwIcons.Location")));
			this.lvwIcons.MultiSelect = false;
			this.lvwIcons.Name = "lvwIcons";
			this.lvwIcons.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lvwIcons.RightToLeft")));
			this.lvwIcons.Size = ((System.Drawing.Size)(resources.GetObject("lvwIcons.Size")));
			this.lvwIcons.TabIndex = ((int)(resources.GetObject("lvwIcons.TabIndex")));
			this.lvwIcons.Text = resources.GetString("lvwIcons.Text");
			this.lvwIcons.Visible = ((bool)(resources.GetObject("lvwIcons.Visible")));
			this.lvwIcons.DoubleClick += new System.EventHandler(this.lvwIcons_DoubleClick);
			this.lvwIcons.SelectedIndexChanged += new System.EventHandler(this.lvwIcons_SelectedIndexChanged);
			// 
			// imglTreeNode
			// 
			this.imglTreeNode.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
			this.imglTreeNode.ImageSize = ((System.Drawing.Size)(resources.GetObject("imglTreeNode.ImageSize")));
			this.imglTreeNode.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglTreeNode.ImageStream")));
			this.imglTreeNode.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// lblLabelMenuEntry
			// 
			this.lblLabelMenuEntry.AccessibleDescription = resources.GetString("lblLabelMenuEntry.AccessibleDescription");
			this.lblLabelMenuEntry.AccessibleName = resources.GetString("lblLabelMenuEntry.AccessibleName");
			this.lblLabelMenuEntry.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLabelMenuEntry.Anchor")));
			this.lblLabelMenuEntry.AutoSize = ((bool)(resources.GetObject("lblLabelMenuEntry.AutoSize")));
			this.lblLabelMenuEntry.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLabelMenuEntry.Dock")));
			this.lblLabelMenuEntry.Enabled = ((bool)(resources.GetObject("lblLabelMenuEntry.Enabled")));
			this.lblLabelMenuEntry.Font = ((System.Drawing.Font)(resources.GetObject("lblLabelMenuEntry.Font")));
			this.lblLabelMenuEntry.Image = ((System.Drawing.Image)(resources.GetObject("lblLabelMenuEntry.Image")));
			this.lblLabelMenuEntry.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelMenuEntry.ImageAlign")));
			this.lblLabelMenuEntry.ImageIndex = ((int)(resources.GetObject("lblLabelMenuEntry.ImageIndex")));
			this.lblLabelMenuEntry.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLabelMenuEntry.ImeMode")));
			this.lblLabelMenuEntry.Location = ((System.Drawing.Point)(resources.GetObject("lblLabelMenuEntry.Location")));
			this.lblLabelMenuEntry.Name = "lblLabelMenuEntry";
			this.lblLabelMenuEntry.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLabelMenuEntry.RightToLeft")));
			this.lblLabelMenuEntry.Size = ((System.Drawing.Size)(resources.GetObject("lblLabelMenuEntry.Size")));
			this.lblLabelMenuEntry.TabIndex = ((int)(resources.GetObject("lblLabelMenuEntry.TabIndex")));
			this.lblLabelMenuEntry.Text = resources.GetString("lblLabelMenuEntry.Text");
			this.lblLabelMenuEntry.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLabelMenuEntry.TextAlign")));
			this.lblLabelMenuEntry.Visible = ((bool)(resources.GetObject("lblLabelMenuEntry.Visible")));
			// 
			// radCollapsed
			// 
			this.radCollapsed.AccessibleDescription = resources.GetString("radCollapsed.AccessibleDescription");
			this.radCollapsed.AccessibleName = resources.GetString("radCollapsed.AccessibleName");
			this.radCollapsed.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radCollapsed.Anchor")));
			this.radCollapsed.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radCollapsed.Appearance")));
			this.radCollapsed.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radCollapsed.BackgroundImage")));
			this.radCollapsed.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radCollapsed.CheckAlign")));
			this.radCollapsed.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radCollapsed.Dock")));
			this.radCollapsed.Enabled = ((bool)(resources.GetObject("radCollapsed.Enabled")));
			this.radCollapsed.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radCollapsed.FlatStyle")));
			this.radCollapsed.Font = ((System.Drawing.Font)(resources.GetObject("radCollapsed.Font")));
			this.radCollapsed.ForeColor = System.Drawing.Color.Maroon;
			this.radCollapsed.Image = ((System.Drawing.Image)(resources.GetObject("radCollapsed.Image")));
			this.radCollapsed.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radCollapsed.ImageAlign")));
			this.radCollapsed.ImageIndex = ((int)(resources.GetObject("radCollapsed.ImageIndex")));
			this.radCollapsed.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radCollapsed.ImeMode")));
			this.radCollapsed.Location = ((System.Drawing.Point)(resources.GetObject("radCollapsed.Location")));
			this.radCollapsed.Name = "radCollapsed";
			this.radCollapsed.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radCollapsed.RightToLeft")));
			this.radCollapsed.Size = ((System.Drawing.Size)(resources.GetObject("radCollapsed.Size")));
			this.radCollapsed.TabIndex = ((int)(resources.GetObject("radCollapsed.TabIndex")));
			this.radCollapsed.Text = resources.GetString("radCollapsed.Text");
			this.radCollapsed.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radCollapsed.TextAlign")));
			this.radCollapsed.Visible = ((bool)(resources.GetObject("radCollapsed.Visible")));
			// 
			// radExpanded
			// 
			this.radExpanded.AccessibleDescription = resources.GetString("radExpanded.AccessibleDescription");
			this.radExpanded.AccessibleName = resources.GetString("radExpanded.AccessibleName");
			this.radExpanded.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radExpanded.Anchor")));
			this.radExpanded.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radExpanded.Appearance")));
			this.radExpanded.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radExpanded.BackgroundImage")));
			this.radExpanded.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radExpanded.CheckAlign")));
			this.radExpanded.Checked = true;
			this.radExpanded.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radExpanded.Dock")));
			this.radExpanded.Enabled = ((bool)(resources.GetObject("radExpanded.Enabled")));
			this.radExpanded.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radExpanded.FlatStyle")));
			this.radExpanded.Font = ((System.Drawing.Font)(resources.GetObject("radExpanded.Font")));
			this.radExpanded.ForeColor = System.Drawing.Color.Maroon;
			this.radExpanded.Image = ((System.Drawing.Image)(resources.GetObject("radExpanded.Image")));
			this.radExpanded.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radExpanded.ImageAlign")));
			this.radExpanded.ImageIndex = ((int)(resources.GetObject("radExpanded.ImageIndex")));
			this.radExpanded.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radExpanded.ImeMode")));
			this.radExpanded.Location = ((System.Drawing.Point)(resources.GetObject("radExpanded.Location")));
			this.radExpanded.Name = "radExpanded";
			this.radExpanded.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radExpanded.RightToLeft")));
			this.radExpanded.Size = ((System.Drawing.Size)(resources.GetObject("radExpanded.Size")));
			this.radExpanded.TabIndex = ((int)(resources.GetObject("radExpanded.TabIndex")));
			this.radExpanded.TabStop = true;
			this.radExpanded.Text = resources.GetString("radExpanded.Text");
			this.radExpanded.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radExpanded.TextAlign")));
			this.radExpanded.Visible = ((bool)(resources.GetObject("radExpanded.Visible")));
			// 
			// picCollapsed
			// 
			this.picCollapsed.AccessibleDescription = resources.GetString("picCollapsed.AccessibleDescription");
			this.picCollapsed.AccessibleName = resources.GetString("picCollapsed.AccessibleName");
			this.picCollapsed.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("picCollapsed.Anchor")));
			this.picCollapsed.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picCollapsed.BackgroundImage")));
			this.picCollapsed.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("picCollapsed.Dock")));
			this.picCollapsed.Enabled = ((bool)(resources.GetObject("picCollapsed.Enabled")));
			this.picCollapsed.Font = ((System.Drawing.Font)(resources.GetObject("picCollapsed.Font")));
			this.picCollapsed.Image = ((System.Drawing.Image)(resources.GetObject("picCollapsed.Image")));
			this.picCollapsed.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("picCollapsed.ImeMode")));
			this.picCollapsed.Location = ((System.Drawing.Point)(resources.GetObject("picCollapsed.Location")));
			this.picCollapsed.Name = "picCollapsed";
			this.picCollapsed.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("picCollapsed.RightToLeft")));
			this.picCollapsed.Size = ((System.Drawing.Size)(resources.GetObject("picCollapsed.Size")));
			this.picCollapsed.SizeMode = ((System.Windows.Forms.PictureBoxSizeMode)(resources.GetObject("picCollapsed.SizeMode")));
			this.picCollapsed.TabIndex = ((int)(resources.GetObject("picCollapsed.TabIndex")));
			this.picCollapsed.TabStop = false;
			this.picCollapsed.Text = resources.GetString("picCollapsed.Text");
			this.picCollapsed.Visible = ((bool)(resources.GetObject("picCollapsed.Visible")));
			// 
			// picExpanded
			// 
			this.picExpanded.AccessibleDescription = resources.GetString("picExpanded.AccessibleDescription");
			this.picExpanded.AccessibleName = resources.GetString("picExpanded.AccessibleName");
			this.picExpanded.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("picExpanded.Anchor")));
			this.picExpanded.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picExpanded.BackgroundImage")));
			this.picExpanded.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("picExpanded.Dock")));
			this.picExpanded.Enabled = ((bool)(resources.GetObject("picExpanded.Enabled")));
			this.picExpanded.Font = ((System.Drawing.Font)(resources.GetObject("picExpanded.Font")));
			this.picExpanded.Image = ((System.Drawing.Image)(resources.GetObject("picExpanded.Image")));
			this.picExpanded.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("picExpanded.ImeMode")));
			this.picExpanded.Location = ((System.Drawing.Point)(resources.GetObject("picExpanded.Location")));
			this.picExpanded.Name = "picExpanded";
			this.picExpanded.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("picExpanded.RightToLeft")));
			this.picExpanded.Size = ((System.Drawing.Size)(resources.GetObject("picExpanded.Size")));
			this.picExpanded.SizeMode = ((System.Windows.Forms.PictureBoxSizeMode)(resources.GetObject("picExpanded.SizeMode")));
			this.picExpanded.TabIndex = ((int)(resources.GetObject("picExpanded.TabIndex")));
			this.picExpanded.TabStop = false;
			this.picExpanded.Text = resources.GetString("picExpanded.Text");
			this.picExpanded.Visible = ((bool)(resources.GetObject("picExpanded.Visible")));
			// 
			// btnCancel
			// 
			this.btnCancel.AccessibleDescription = resources.GetString("btnCancel.AccessibleDescription");
			this.btnCancel.AccessibleName = resources.GetString("btnCancel.AccessibleName");
			this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnCancel.Anchor")));
			this.btnCancel.BackColor = System.Drawing.SystemColors.Control;
			this.btnCancel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCancel.BackgroundImage")));
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnCancel.Dock")));
			this.btnCancel.Enabled = ((bool)(resources.GetObject("btnCancel.Enabled")));
			this.btnCancel.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnCancel.FlatStyle")));
			this.btnCancel.Font = ((System.Drawing.Font)(resources.GetObject("btnCancel.Font")));
			this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
			this.btnCancel.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCancel.ImageAlign")));
			this.btnCancel.ImageIndex = ((int)(resources.GetObject("btnCancel.ImageIndex")));
			this.btnCancel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnCancel.ImeMode")));
			this.btnCancel.Location = ((System.Drawing.Point)(resources.GetObject("btnCancel.Location")));
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnCancel.RightToLeft")));
			this.btnCancel.Size = ((System.Drawing.Size)(resources.GetObject("btnCancel.Size")));
			this.btnCancel.TabIndex = ((int)(resources.GetObject("btnCancel.TabIndex")));
			this.btnCancel.Text = resources.GetString("btnCancel.Text");
			this.btnCancel.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCancel.TextAlign")));
			this.btnCancel.Visible = ((bool)(resources.GetObject("btnCancel.Visible")));
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// btnOk
			// 
			this.btnOk.AccessibleDescription = resources.GetString("btnOk.AccessibleDescription");
			this.btnOk.AccessibleName = resources.GetString("btnOk.AccessibleName");
			this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnOk.Anchor")));
			this.btnOk.BackColor = System.Drawing.SystemColors.Control;
			this.btnOk.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnOk.BackgroundImage")));
			this.btnOk.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnOk.Dock")));
			this.btnOk.Enabled = ((bool)(resources.GetObject("btnOk.Enabled")));
			this.btnOk.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnOk.FlatStyle")));
			this.btnOk.Font = ((System.Drawing.Font)(resources.GetObject("btnOk.Font")));
			this.btnOk.Image = ((System.Drawing.Image)(resources.GetObject("btnOk.Image")));
			this.btnOk.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOk.ImageAlign")));
			this.btnOk.ImageIndex = ((int)(resources.GetObject("btnOk.ImageIndex")));
			this.btnOk.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnOk.ImeMode")));
			this.btnOk.Location = ((System.Drawing.Point)(resources.GetObject("btnOk.Location")));
			this.btnOk.Name = "btnOk";
			this.btnOk.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnOk.RightToLeft")));
			this.btnOk.Size = ((System.Drawing.Size)(resources.GetObject("btnOk.Size")));
			this.btnOk.TabIndex = ((int)(resources.GetObject("btnOk.TabIndex")));
			this.btnOk.Text = resources.GetString("btnOk.Text");
			this.btnOk.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOk.TextAlign")));
			this.btnOk.Visible = ((bool)(resources.GetObject("btnOk.Visible")));
			this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
			// 
			// txtMenuName
			// 
			this.txtMenuName.AccessibleDescription = resources.GetString("txtMenuName.AccessibleDescription");
			this.txtMenuName.AccessibleName = resources.GetString("txtMenuName.AccessibleName");
			this.txtMenuName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtMenuName.Anchor")));
			this.txtMenuName.AutoSize = ((bool)(resources.GetObject("txtMenuName.AutoSize")));
			this.txtMenuName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtMenuName.BackgroundImage")));
			this.txtMenuName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtMenuName.Dock")));
			this.txtMenuName.Enabled = ((bool)(resources.GetObject("txtMenuName.Enabled")));
			this.txtMenuName.Font = ((System.Drawing.Font)(resources.GetObject("txtMenuName.Font")));
			this.txtMenuName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtMenuName.ImeMode")));
			this.txtMenuName.Location = ((System.Drawing.Point)(resources.GetObject("txtMenuName.Location")));
			this.txtMenuName.MaxLength = ((int)(resources.GetObject("txtMenuName.MaxLength")));
			this.txtMenuName.Multiline = ((bool)(resources.GetObject("txtMenuName.Multiline")));
			this.txtMenuName.Name = "txtMenuName";
			this.txtMenuName.PasswordChar = ((char)(resources.GetObject("txtMenuName.PasswordChar")));
			this.txtMenuName.ReadOnly = true;
			this.txtMenuName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtMenuName.RightToLeft")));
			this.txtMenuName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtMenuName.ScrollBars")));
			this.txtMenuName.Size = ((System.Drawing.Size)(resources.GetObject("txtMenuName.Size")));
			this.txtMenuName.TabIndex = ((int)(resources.GetObject("txtMenuName.TabIndex")));
			this.txtMenuName.TabStop = false;
			this.txtMenuName.Text = resources.GetString("txtMenuName.Text");
			this.txtMenuName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtMenuName.TextAlign")));
			this.txtMenuName.Visible = ((bool)(resources.GetObject("txtMenuName.Visible")));
			this.txtMenuName.WordWrap = ((bool)(resources.GetObject("txtMenuName.WordWrap")));
			// 
			// SelectIcon
			// 
			this.AcceptButton = this.btnOk;
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.CancelButton = this.btnCancel;
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.txtMenuName);
			this.Controls.Add(this.radExpanded);
			this.Controls.Add(this.radCollapsed);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnOk);
			this.Controls.Add(this.picExpanded);
			this.Controls.Add(this.picCollapsed);
			this.Controls.Add(this.lblLabelMenuEntry);
			this.Controls.Add(this.lvwIcons);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximizeBox = false;
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimizeBox = false;
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "SelectIcon";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.Load += new System.EventHandler(this.SelectIcon_Load);
			this.ResumeLayout(false);

		}
		#endregion
				
		#region Class's Method And Properties

        public Sys_Menu_Entry MenuEntry = new Sys_Menu_Entry();
		

		public bool IsGroup
		{
			set { mIsGroup = value; }
			get {return mIsGroup; }
		}

		#endregion Class's Method

		#region Event Processing
	
		private void SelectIcon_Load(object sender, System.EventArgs e)
		{
			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.WaitCursor;

			#endregion Code Inserted Automatically

			
			// Code Inserted Automatically
			const string METHOD_NAME = THIS + ".SelectIcon_Load";
			try
			{
				const string STR_NODE = "";
				
				#region Security
				//Set authorization for user
				Security objSecurity = new Security();
				this.Name = THIS;
				if(objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
				{
					// You don't have the right to view this item
					this.Hide();
					PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
					this.Close();					
					// Code Inserted Automatically
#region Code Inserted Automatically
this.Cursor = Cursors.Default;
#endregion Code Inserted Automatically

					return;
				}
				#endregion

				for (int i = 0; i < imglTreeNode.Images.Count; i++)
				{
					lvwIcons.Items.Add(STR_NODE,i);
				}
				if (mMenuEntry == null)
				{
					this.Close();
					return;
				}
				int nCollapsed = mMenuEntry.CollapsedImage - 1;
				int nExpanded = mMenuEntry.ExpandedImage - 1;

				if (mIsGroup)
				{
					if (nCollapsed < 0)
					{
						nCollapsed = IDX_IMAGE_FOLDER;
					}
					if (nExpanded < 0)
					{
						nExpanded = IDX_IMAGE_EXPANDED_FOLDER;
					}
				}
				else
				{
					if (nCollapsed < 0)
					{
						nCollapsed = IDX_IMAGE_FORM;
					}
					if (nExpanded < 0)
					{
						nExpanded = IDX_IMAGE_FORM;
					}
				}
				picCollapsed.Image = imglTreeNode.Images[nCollapsed];
				picExpanded.Image = imglTreeNode.Images[nExpanded];

				txtMenuName.Text = mMenuEntry.Text_CaptionDefault;
				if (!mIsGroup)
				{
					radCollapsed.Enabled = radExpanded.Enabled = false;
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
				}
			}

			// Code Inserted Automatically	

			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.Default;

			#endregion Code Inserted Automatically

			
		}

		
		private void lvwIcons_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".lvwIcons_SelectedIndexChanged";
			try
			{
				if (lvwIcons.SelectedIndices.Count == 0)
				{
					return;
				}
				if (mIsGroup)
				{
					if (radCollapsed.Checked)
					{
						picCollapsed.Image = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
						mMenuEntry.CollapsedImage = lvwIcons.SelectedIndices[0] + 1;
					}
					else
					{
						picExpanded.Image = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
						mMenuEntry.ExpandedImage = lvwIcons.SelectedIndices[0] + 1;
					}
				}
				else
				{
					picExpanded.Image = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
					picCollapsed.Image = imglTreeNode.Images[lvwIcons.SelectedIndices[0]];
					mMenuEntry.ExpandedImage = mMenuEntry.CollapsedImage = lvwIcons.SelectedIndices[0] + 1;
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
				}
			}
		}

		private void btnOk_Click(object sender, System.EventArgs e)
		{
			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.WaitCursor;

			#endregion Code Inserted Automatically

			
			DialogResult = DialogResult.OK;
			//PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA, MessageBoxIcon.Information);
			this.Close();

			// Code Inserted Automatically

			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.Default;

			#endregion Code Inserted Automatically

			
		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{		
			// Code Inserted Automatically
		
			#region Code Inserted Automatically
		
			this.Cursor = Cursors.WaitCursor;
		
			#endregion Code Inserted Automatically
		
					
			// Code Inserted Automatically		
			DialogResult = DialogResult.Cancel;
			this.Close();			
		
			// Code Inserted Automatically
		
			#region Code Inserted Automatically
		
			this.Cursor = Cursors.Default;
		
			#endregion Code Inserted Automatically
		
			
		}

		private void lvwIcons_DoubleClick(object sender, System.EventArgs e)
		{
			btnOk_Click(null,null);
		}

		#endregion Event Processing
	}
}